<%-- 
    Document   : request_permisos
    Created on : 28/09/2011, 07:57:57 PM
    Author     : Jose
--%>

<%@ page import="PaquetesJL.*" %>
<%@page import="java.sql.ResultSet" %>

<%
    String id_permiso=request.getParameter("id_permiso");
    String id_rol=request.getParameter("id_rol");
    String permitido=request.getParameter("permitido");
            
    String sqlServer = pageContext.getServletContext().getInitParameter("sqlServer");
    String databaseName = pageContext.getServletContext().getInitParameter("databaseName");
    String userName = pageContext.getServletContext().getInitParameter("userName");
    String PasswordP = pageContext.getServletContext().getInitParameter("password");
    String Backup = pageContext.getServletContext().getInitParameter("RutaBackup");
        
    byte[] decodedBytes = ConexionBD.decode(PasswordP);
    String decodedPassword = new String(decodedBytes).trim();
        
    ConexionBD Conexion = new ConexionBD(sqlServer, databaseName, userName, decodedPassword, Backup);        
    Conexion.IniciarConexion();
    ResultSet r=Conexion.EjecutarConsulta("EXEC dbo.ModificarRol "+id_permiso+","+id_rol+","+permitido+";");                           
    if(r.next()){
        out.println(r.getString(1));
    }
    Conexion.CerrarConexion();
%>
